package jinyilw.swing.rlaf.ui;

import jinyilw.swing.rlaf.utils.RBorderFactory;

import javax.swing.JComponent;
import javax.swing.border.Border;
import javax.swing.plaf.ComponentUI;
import javax.swing.plaf.basic.BasicOptionPaneUI;
import java.awt.Graphics;

/**
 * @author Jinyi
 */
public class ROptionPaneUI extends BasicOptionPaneUI
{
	static final Border border = new RBorderFactory.EmptyBorder(10, 10, 15, 15);
	public static ComponentUI createUI(JComponent c)
	{
		return new ROptionPaneUI();
	}

	@Override
	public void installUI(JComponent c)
	{
		super.installUI(c);
		c.setOpaque(false);
	}

	@Override
	protected void installComponents()
	{
		// TODO 自动生成的方法存根
		super.installComponents();
		optionPane.setBorder(border);
	}

	@Override
	public void update(Graphics g, JComponent c)
	{
		// super.update(g, c);
	}

	@Override
	protected boolean getSizeButtonsToSameWidth()
	{
		return false;
	}
}
